import request from '@/utils/request'

export const getFangchanList = (_limit,_start,title_contains,agent,category) => request({
  url: '/properties',
  params: {
    _limit,
    _start,
    title_contains,
    agent,
    category
  }
})

export const getFangchanCount = (_limit,_start,title_contains,agent,category) => request({
  url: '/properties/count',
  params: {
    _limit,
    _start,
    title_contains,
    agent,
    category
  }
})

export const getfenleiList = (_limit,_start,title_contains) => request({
  url: '/categories',
  params: {
    _limit,
    _start,
    title_contains
  }
})

export const addFangchan = data => request({
  url: '/properties',
  data,
  method:'post'
})

export const editFangchan = data => request({
  url: '/properties/'+ data.id,
  data,
  method:'PUT'
})

export const oneFangchan = id => request({
  url: '/properties/'+ id,
})

export const delFangchan = id => request({
  url: '/properties/'+ id,
  method:'delete'
})



